<?php
namespace app\admin\controller;
use think\Exception;
class IndexController extends CommonController
{
    public $initModel   =true;
    public $is_verify   =false;
    public $is_strictly =true;

    protected function _beforeWhere(&$where)
    {
        unset($where['page']);
        if($this->action==='update' && $this->request->isPut()){
            $exists                     =   array_key_exists('id',$where);
            if(false===$exists){throw new Exception('抱歉参数错误缺少主键',self::RESPONSE_SUCCESS);}
            $where_param                =   [];
            $where_param['id']          =   ['eq',$where['id']];
            $where                      =   $where_param;
        }
    }



    protected function _beforeParam(&$param)
    {

    }

}
